package com.iwhalecloud.bss.kite.cucc.service.attr.handler;


import com.iwhalecloud.bss.kite.common.constant.KeyConsts;
import com.iwhalecloud.bss.kite.common.util.KiteStringUtils;
import com.iwhalecloud.bss.kite.cucc.service.util.ProdCateUtil;
import com.iwhalecloud.bss.kite.manager.api.IOperateSceneInstService;
import com.iwhalecloud.bss.kite.manager.inst.KiteAttr;
import com.iwhalecloud.bss.kite.manager.inst.KiteInst;
import com.iwhalecloud.bss.kite.service.attr.AttrData;
import com.iwhalecloud.bss.kite.service.attr.data.CustAttrData;
import com.iwhalecloud.bss.kite.service.attr.handler.AbstractAttrHandler;
import org.springframework.beans.factory.annotation.Autowired;

public class VehiclePositioningAttrHandler extends AbstractAttrHandler<KiteInst, CustAttrData> {
    @Autowired
    private IOperateSceneInstService operateSceneInstService;

    @Override
    public void after(KiteAttr attr, KiteInst inst, CustAttrData data) {
        super.after(attr, inst, data);
        ////4G定制化连接除去业务场景、管理员姓名、管理员电话、管理员邮箱属性，其它属性都置灰
        if(KiteStringUtils.isEqual(data.getServiceOfferId(), "2826")){
            if(KiteStringUtils.equalsAny(inst.getSpecId(),"50000028")){
                //企业自采
                inst.getAttrMap().get("200003676").setIsEdit(KeyConsts.IFTRUE_F);
                //合同约定开卡数量
                inst.getAttrMap().get("200003677").setIsEdit(KeyConsts.IFTRUE_F);
                //产品服务期限
                inst.getAttrMap().get("200004106").setIsEdit(KeyConsts.IFTRUE_F);
                //承载平台
                inst.getAttrMap().get("200003675").setIsEdit(KeyConsts.IFTRUE_F);
                //SIM卡类型
                inst.getAttrMap().get("200003678").setIsEdit(KeyConsts.IFTRUE_F);
                //卡号数据服务费(元/张)
                inst.getAttrMap().get("200003679").setIsEdit(KeyConsts.IFTRUE_F);
                operateSceneInstService
                        .setAttr(data.getSceneInstId(), inst.getInstType(), inst.getInstId(), attr);
            }
        }
    }
}
